
/**
 * Created by Dominik on 2014-10-17.
 */
public abstract class Card {

    private static String[] suits = {"hearts", "spades", "diamonds", "clubs"};//serce,wino,romb,trefl
    private static String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"};

    public static String getLowerRank(String rankOne, String rankTwo) {
        int one = -1;
        int two = -1;
        for(int i = 0; i < ranks.length; i++){
            if(rankOne.compareTo(ranks[i]) == 0)
                one = i;
            if(rankTwo.compareTo(ranks[i]) == 0)
                two = i;
        }
        if (one <= two)
            return ranks[one];
        else
            return ranks[two];
    }
    public static String getHigherRank(String rankOne, String rankTwo) {
        int one = -1;
        int two = -1;
        for(int i = 0; i < ranks.length; i++){
            if(rankOne.compareTo(ranks[i]) == 0)
                one = i;
            if(rankTwo.compareTo(ranks[i]) == 0)
                two = i;
        }
        if (one >= two)
            return ranks[one];
        else
            return ranks[two];
    }

    public static String getString (int suit, int rank) {
        return (ranks[rank]+ suits[suit]);
    }

    public static String getSuit(int suit){
        return suits[suit];
    }

    public static String getRank(int rank){
        return ranks[rank];
    }

}
